class BiliInfo {
  int code;
  String message;
  int ttl;
  Data data;

  BiliInfo({this.code, this.message, this.ttl, this.data});

  BiliInfo.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    message = json['message'];
    ttl = json['ttl'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['message'] = this.message;
    data['ttl'] = this.ttl;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class Data {
  int mid;
  String name;
  String sex;
  String face;
  String sign;
  int rank;
  int level;
  int jointime;
  int moral;
  int silence;
  String birthday;
  double coins;
  bool fansBadge;
  Official official;
  Vip vip;
  Pendant pendant;
  Nameplate nameplate;
  bool isFollowed;
  String topPhoto;
  Theme theme;
  Theme sysNotice;
  LiveRoom liveRoom;

  Data(
      {this.mid,
      this.name,
      this.sex,
      this.face,
      this.sign,
      this.rank,
      this.level,
      this.jointime,
      this.moral,
      this.silence,
      this.birthday,
      this.coins,
      this.fansBadge,
      this.official,
      this.vip,
      this.pendant,
      this.nameplate,
      this.isFollowed,
      this.topPhoto,
      this.theme,
      this.sysNotice,
      this.liveRoom});

  Data.fromJson(Map<String, dynamic> json) {
    mid = json['mid'];
    name = json['name'];
    sex = json['sex'];
    face = json['face'];
    sign = json['sign'];
    rank = json['rank'];
    level = json['level'];
    jointime = json['jointime'];
    moral = json['moral'];
    silence = json['silence'];
    birthday = json['birthday'];
    coins = json['coins'];
    fansBadge = json['fans_badge'];
    official = json['official'] != null
        ? new Official.fromJson(json['official'])
        : null;
    vip = json['vip'] != null ? new Vip.fromJson(json['vip']) : null;
    pendant =
        json['pendant'] != null ? new Pendant.fromJson(json['pendant']) : null;
    nameplate = json['nameplate'] != null
        ? new Nameplate.fromJson(json['nameplate'])
        : null;
    isFollowed = json['is_followed'];
    topPhoto = json['top_photo'];
    theme = json['theme'] != null ? new Theme.fromJson(json['theme']) : null;
    sysNotice = json['sys_notice'] != null
        ? new Theme.fromJson(json['sys_notice'])
        : null;
    liveRoom = json['live_room'] != null
        ? new LiveRoom.fromJson(json['live_room'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['mid'] = this.mid;
    data['name'] = this.name;
    data['sex'] = this.sex;
    data['face'] = this.face;
    data['sign'] = this.sign;
    data['rank'] = this.rank;
    data['level'] = this.level;
    data['jointime'] = this.jointime;
    data['moral'] = this.moral;
    data['silence'] = this.silence;
    data['birthday'] = this.birthday;
    data['coins'] = this.coins;
    data['fans_badge'] = this.fansBadge;
    if (this.official != null) {
      data['official'] = this.official.toJson();
    }
    if (this.vip != null) {
      data['vip'] = this.vip.toJson();
    }
    if (this.pendant != null) {
      data['pendant'] = this.pendant.toJson();
    }
    if (this.nameplate != null) {
      data['nameplate'] = this.nameplate.toJson();
    }
    data['is_followed'] = this.isFollowed;
    data['top_photo'] = this.topPhoto;
    if (this.theme != null) {
      data['theme'] = this.theme.toJson();
    }
    if (this.sysNotice != null) {
      data['sys_notice'] = this.sysNotice.toJson();
    }
    if (this.liveRoom != null) {
      data['live_room'] = this.liveRoom.toJson();
    }
    return data;
  }
}

class Official {
  int role;
  String title;
  String desc;
  int type;

  Official({this.role, this.title, this.desc, this.type});

  Official.fromJson(Map<String, dynamic> json) {
    role = json['role'];
    title = json['title'];
    desc = json['desc'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['role'] = this.role;
    data['title'] = this.title;
    data['desc'] = this.desc;
    data['type'] = this.type;
    return data;
  }
}

class Vip {
  int type;
  int status;
  int themeType;
  Label label;
  int avatarSubscript;
  String nicknameColor;

  Vip(
      {this.type,
      this.status,
      this.themeType,
      this.label,
      this.avatarSubscript,
      this.nicknameColor});

  Vip.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    status = json['status'];
    themeType = json['theme_type'];
    label = json['label'] != null ? new Label.fromJson(json['label']) : null;
    avatarSubscript = json['avatar_subscript'];
    nicknameColor = json['nickname_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['status'] = this.status;
    data['theme_type'] = this.themeType;
    if (this.label != null) {
      data['label'] = this.label.toJson();
    }
    data['avatar_subscript'] = this.avatarSubscript;
    data['nickname_color'] = this.nicknameColor;
    return data;
  }
}

class Label {
  String path;
  String text;
  String labelTheme;

  Label({this.path, this.text, this.labelTheme});

  Label.fromJson(Map<String, dynamic> json) {
    path = json['path'];
    text = json['text'];
    labelTheme = json['label_theme'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['path'] = this.path;
    data['text'] = this.text;
    data['label_theme'] = this.labelTheme;
    return data;
  }
}

class Pendant {
  int pid;
  String name;
  String image;
  int expire;
  String imageEnhance;
  String imageEnhanceFrame;

  Pendant(
      {this.pid,
      this.name,
      this.image,
      this.expire,
      this.imageEnhance,
      this.imageEnhanceFrame});

  Pendant.fromJson(Map<String, dynamic> json) {
    pid = json['pid'];
    name = json['name'];
    image = json['image'];
    expire = json['expire'];
    imageEnhance = json['image_enhance'];
    imageEnhanceFrame = json['image_enhance_frame'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['pid'] = this.pid;
    data['name'] = this.name;
    data['image'] = this.image;
    data['expire'] = this.expire;
    data['image_enhance'] = this.imageEnhance;
    data['image_enhance_frame'] = this.imageEnhanceFrame;
    return data;
  }
}

class Nameplate {
  int nid;
  String name;
  String image;
  String imageSmall;
  String level;
  String condition;

  Nameplate(
      {this.nid,
      this.name,
      this.image,
      this.imageSmall,
      this.level,
      this.condition});

  Nameplate.fromJson(Map<String, dynamic> json) {
    nid = json['nid'];
    name = json['name'];
    image = json['image'];
    imageSmall = json['image_small'];
    level = json['level'];
    condition = json['condition'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['nid'] = this.nid;
    data['name'] = this.name;
    data['image'] = this.image;
    data['image_small'] = this.imageSmall;
    data['level'] = this.level;
    data['condition'] = this.condition;
    return data;
  }
}

class Theme {
  Theme.fromJson(Map<String, dynamic> json);

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    return data;
  }
}

class LiveRoom {
  int roomStatus;
  int liveStatus;
  String url;
  String title;
  String cover;
  int online;
  int roomid;
  int roundStatus;
  int broadcastType;

  LiveRoom(
      {this.roomStatus,
      this.liveStatus,
      this.url,
      this.title,
      this.cover,
      this.online,
      this.roomid,
      this.roundStatus,
      this.broadcastType});

  LiveRoom.fromJson(Map<String, dynamic> json) {
    roomStatus = json['roomStatus'];
    liveStatus = json['liveStatus'];
    url = json['url'];
    title = json['title'];
    cover = json['cover'];
    online = json['online'];
    roomid = json['roomid'];
    roundStatus = json['roundStatus'];
    broadcastType = json['broadcast_type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['roomStatus'] = this.roomStatus;
    data['liveStatus'] = this.liveStatus;
    data['url'] = this.url;
    data['title'] = this.title;
    data['cover'] = this.cover;
    data['online'] = this.online;
    data['roomid'] = this.roomid;
    data['roundStatus'] = this.roundStatus;
    data['broadcast_type'] = this.broadcastType;
    return data;
  }
}

// class Data {
// 	int mid;
// 	String name;
// 	String sex;
// 	String face;
// 	String sign;
// 	int rank;
// 	int level;
// 	int jointime;
// 	int moral;
// 	int silence;
// 	String birthday;
// 	double coins;
// 	bool fansBadge;
// 	Official official;
// 	Vip vip;
// 	Pendant pendant;
// 	Nameplate nameplate;
// 	bool isFollowed;
// 	String topPhoto;
// 	Theme theme;
// 	Theme sysNotice;
// 	LiveRoom liveRoom;

// 	Data({this.mid, this.name, this.sex, this.face, this.sign, this.rank, this.level, this.jointime, this.moral, this.silence, this.birthday, this.coins, this.fansBadge, this.official, this.vip, this.pendant, this.nameplate, this.isFollowed, this.topPhoto, this.theme, this.sysNotice, this.liveRoom});

// 	Data.fromJson(Map<String, dynamic> json) {
// 		mid = json['mid'];
// 		name = json['name'];
// 		sex = json['sex'];
// 		face = json['face'];
// 		sign = json['sign'];
// 		rank = json['rank'];
// 		level = json['level'];
// 		jointime = json['jointime'];
// 		moral = json['moral'];
// 		silence = json['silence'];
// 		birthday = json['birthday'];
// 		coins = json['coins'];
// 		fansBadge = json['fans_badge'];
// 		official = json['official'] != null ? new Official.fromJson(json['official']) : null;
// 		vip = json['vip'] != null ? new Vip.fromJson(json['vip']) : null;
// 		pendant = json['pendant'] != null ? new Pendant.fromJson(json['pendant']) : null;
// 		nameplate = json['nameplate'] != null ? new Nameplate.fromJson(json['nameplate']) : null;
// 		isFollowed = json['is_followed'];
// 		topPhoto = json['top_photo'];
// 		theme = json['theme'] != null ? new Theme.fromJson(json['theme']) : null;
// 		sysNotice = json['sys_notice'] != null ? new Theme.fromJson(json['sys_notice']) : null;
// 		liveRoom = json['live_room'] != null ? new LiveRoom.fromJson(json['live_room']) : null;
// 	}

// 	Map<String, dynamic> toJson() {
// 		final Map<String, dynamic> data = new Map<String, dynamic>();
// 		data['mid'] = this.mid;
// 		data['name'] = this.name;
// 		data['sex'] = this.sex;
// 		data['face'] = this.face;
// 		data['sign'] = this.sign;
// 		data['rank'] = this.rank;
// 		data['level'] = this.level;
// 		data['jointime'] = this.jointime;
// 		data['moral'] = this.moral;
// 		data['silence'] = this.silence;
// 		data['birthday'] = this.birthday;
// 		data['coins'] = this.coins;
// 		data['fans_badge'] = this.fansBadge;
// 		if (this.official != null) {
//       data['official'] = this.official.toJson();
//     }
// 		if (this.vip != null) {
//       data['vip'] = this.vip.toJson();
//     }
// 		if (this.pendant != null) {
//       data['pendant'] = this.pendant.toJson();
//     }
// 		if (this.nameplate != null) {
//       data['nameplate'] = this.nameplate.toJson();
//     }
// 		data['is_followed'] = this.isFollowed;
// 		data['top_photo'] = this.topPhoto;
// 		if (this.theme != null) {
//       data['theme'] = this.theme.toJson();
//     }
// 		if (this.sysNotice != null) {
//       data['sys_notice'] = this.sysNotice.toJson();
//     }
// 		if (this.liveRoom != null) {
//       data['live_room'] = this.liveRoom.toJson();
//     }
// 		return data;
// 	}
// }
